.class public final Lrexsee/core/browser/clazz/PreloadFilterListener;
.super Lrexsee/core/browser/clazz/FilterListener;
.source "PreloadFilterListener.java"


# static fields
.field public static final PRELOAD_FILTER_NAME:Ljava/lang/String; = "preload"

.field public static final PRELOAD_FILTER_TYPE:Ljava/lang/String; = "preload"


# instance fields
.field private final mMap:Ljava/util/HashMap;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/HashMap",
            "<",
            "Ljava/lang/String;",
            "Ljava/lang/String;",
            ">;"
        }
    .end annotation
.end field


# direct methods
.method public constructor <init>()V
    .locals 2

    .prologue
    const-string v1, "preload"

    .line 16
    const-string v0, "preload"

    const-string v0, "preload"

    invoke-direct {p0, v1, v1}, Lrexsee/core/browser/clazz/FilterListener;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    .line 17
    new-instance v0, Ljava/util/HashMap;

    invoke-direct {v0}, Ljava/util/HashMap;-><init>()V

    iput-object v0, p0, Lrexsee/core/browser/clazz/PreloadFilterListener;->mMap:Ljava/util/HashMap;

    .line 18
    return-void
.end method


# virtual methods
.method public add(Ljava/lang/String;Ljava/lang/String;)V
    .locals 1
    .param p1, "url"    # Ljava/lang/String;
    .param p2, "code"    # Ljava/lang/String;

    .prologue
    .line 26
    invoke-virtual {p0, p1}, Lrexsee/core/browser/clazz/PreloadFilterListener;->addUrl(Ljava/lang/String;)V

    .line 27
    iget-object v0, p0, Lrexsee/core/browser/clazz/PreloadFilterListener;->mMap:Ljava/util/HashMap;

    invoke-virtual {v0, p1, p2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 28
    return-void
.end method

.method public getCode(Ljava/lang/String;)Ljava/lang/String;
    .locals 1
    .param p1, "url"    # Ljava/lang/String;

    .prologue
    .line 38
    iget-object v0, p0, Lrexsee/core/browser/clazz/PreloadFilterListener;->mMap:Ljava/util/HashMap;

    invoke-virtual {v0, p1}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object p0

    .end local p0    # "this":Lrexsee/core/browser/clazz/PreloadFilterListener;
    check-cast p0, Ljava/lang/String;

    return-object p0
.end method

.method public remove()V
    .locals 1

    .prologue
    .line 34
    invoke-virtual {p0}, Lrexsee/core/browser/clazz/PreloadFilterListener;->clearUrls()V

    .line 35
    iget-object v0, p0, Lrexsee/core/browser/clazz/PreloadFilterListener;->mMap:Ljava/util/HashMap;

    invoke-virtual {v0}, Ljava/util/HashMap;->clear()V

    .line 36
    return-void
.end method

.method public remove(Ljava/lang/String;)V
    .locals 1
    .param p1, "url"    # Ljava/lang/String;

    .prologue
    .line 30
    invoke-virtual {p0, p1}, Lrexsee/core/browser/clazz/PreloadFilterListener;->removeUrl(Ljava/lang/String;)V

    .line 31
    iget-object v0, p0, Lrexsee/core/browser/clazz/PreloadFilterListener;->mMap:Ljava/util/HashMap;

    invoke-virtual {v0, p1}, Ljava/util/HashMap;->remove(Ljava/lang/Object;)Ljava/lang/Object;

    .line 32
    return-void
.end method

.method public run(Landroid/content/Context;Lrexsee/core/browser/Browser;Ljava/lang/String;)V
    .locals 7
    .param p1, "context"    # Landroid/content/Context;
    .param p2, "browser"    # Lrexsee/core/browser/Browser;
    .param p3, "url"    # Ljava/lang/String;

    .prologue
    .line 21
    iget-object v0, p0, Lrexsee/core/browser/clazz/PreloadFilterListener;->mMap:Ljava/util/HashMap;

    invoke-virtual {v0, p3}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v6

    check-cast v6, Ljava/lang/String;

    .line 22
    .local v6, "code":Ljava/lang/String;
    if-eqz v6, :cond_0

    iget-object v0, p0, Lrexsee/core/browser/clazz/PreloadFilterListener;->mMap:Ljava/util/HashMap;

    invoke-virtual {v0, p3}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/lang/String;

    const-string v3, "text/html"

    const-string v4, "UTF-8"

    move-object v0, p2

    move-object v1, p3

    move-object v5, p3

    invoke-virtual/range {v0 .. v5}, Lrexsee/core/browser/Browser;->loadDataWithBaseURL(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V

    .line 24
    :goto_0
    return-void

    .line 23
    :cond_0
    invoke-virtual {p2, p3}, Lrexsee/core/browser/Browser;->loadUrl(Ljava/lang/String;)V

    goto :goto_0
.end method
